-
Notifications
You must be signed in to change notification settings - Fork 188
libp2p-record module in reference with go-libp2p-record #890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bb3e781 to
486db99
Compare
|
This PR is same as #776, that branch got deleted by mistake at my end. @seetadev @sumanjeet0012 |
|
@lla-dane : Great, thank you so much Abhinav. Re-ran the CI/CD pipeline.1 test case is failing. Please fix the issue. |
|
@lla-dane : Hi Abhinav. @sumanjeet0012 will be focusing on kad-dht refactor. Please coordinate with him to ensure smooth integration with libp2p-record module. |
|
Hey @sumanjeet0012, any updates with the kad-dht refactor. |
|
@lla-dane As we’ve previously encountered redundancy by working on the same task simultaneously, I’m currently holding off on proceeding further. Once your PR is completed, I’ll begin the remaining refactoring work on the Kademlia DHT. This approach should help us avoid duplication of effort and ensure a more efficient workflow. |
689d44d to
a8bd11d
Compare
a8bd11d to
372e0ec
Compare
- updated the value-store to store key/value pairs in record pb format - Updated the tests related to this change
58220c1 to
ff524e1
Compare
| # TEST PUB-KEY VALIDATORS | ||
|
|
||
| # VALID KEY PAIR | ||
| keypair = create_new_key_pair() | ||
| peer_id = ID.from_pubkey(keypair.public_key) | ||
| key = f"/pk/{peer_id.to_bytes().hex()}" | ||
| value = keypair.public_key.serialize() | ||
|
|
||
| with trio.fail_after(TEST_TIMEOUT): | ||
| await dht_a.put_value(key.encode(), value) | ||
|
|
||
| # INVALID KEY PAIR | ||
| key = "/pk/abcdef1234567890" # Not a valid multihash | ||
| value = b"not-a-real-key" | ||
|
|
||
| with trio.fail_after(TEST_TIMEOUT): | ||
| with pytest.raises(InvalidRecordType, match="valid multihash"): | ||
| await dht_a.put_value(key.encode(), value) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seetadev: Tests showing the integration of libp2p-record-module PK validators with kad-dht
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lla-dane : Great, thank you so much for sharing.
|
@seetadev: Updated the KAD-DHT value-store to store the key/value pairs in protobuf record format in c632824 Now the libp2p-record-module was basically about namespace validators, in which PublicKey validators was already implemented. So now the Namespace validator utils (from libp2p-record-module) is properly integrated with the kad-dht. |
- Create docs/libp2p.records.rst - Update docs/libp2p.peer.rst with new files added - Add test suite for pk type dht records
5231e6b to
cf4fe16
Compare
|
@seetadev: This is the place |
|
Excellent work @lla-dane — this is a really solid update! 🚀 Great to see the protobuf record format now integrated cleanly into the KAD-DHT value store and the namespace validator utils from the libp2p-record module properly wired in. The addition of PublicKey record validator tests is a strong step toward aligning py-libp2p with the go-libp2p implementation. We can definitely hold off on the IPNS record validators for now and revisit once we sync up with the IPFS integration path — your note and the reference to the go-libp2p-kad-dht config are spot on. Everything looks good for final review and merge — excellent progress! |
Tracks #768
WIP: The libp2p-record module for py-libp2p in reference with the go-libp2p-record repo.
Reference: https://github.com/libp2p/go-libp2p-record